<?php

class spPageNew2 extends spPage
{
	private $param;

	public function __construct( $param=null )
	{
		parent::__construct();

		// create defaults if not supplied
		$this->param = array_merge(
			array(
				"heading"			=> "",
				"heading_img"		=> ""
			),
			$param==null?array():$param
		);
	}

	protected function showForm( $id, $dbClass )
	{
		$database		= new $dbClass( $id );
		$formBuilder 	= $database->createFormBuilder();
		
		$form = new spForm(array(
			"method" => "post"
		));
		parent::addChild( $form );
		
		$dlg = spDialog2::create( array(
			"title" 		=> "Editing Order",
			"use_submit"	=> true,
			"buttons" 		=> array(
				array(
					"name"	=> "buttonsave",
					"value" => "save"
				),
				array(
					"name" => "buttontrash",
					"value" => "trash"
				),
				array(
					"name" => "buttondelete",
					"value" => "delete"
				)
			)
		));
		$dlg->addStyle( "width", "500px" );
		$dlg->addChild( $formBuilder );
		$form->addChild( $dlg );
	}
	
}

?>